package com.snail.activity;

import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;

@SuppressWarnings("unused")
public class ActivityRegister extends ActivityBase implements OnClickListener{

	//注册姓名输入框
	private EditText registerNameEdit;
    
    //密码输入框
    private EditText registerPwdEdit;
    
    //密码确认输入框
    private EditText registerPwdConfirmEdit;
    
    //提交注册按钮
    private Button registerCommitButton;
    
    //清除按钮
    private Button rgisterClearBtn;
    private CheckBox registerHasReadChk;
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);
        
        registerNameEdit = (EditText)findViewById(R.id.register_name_edit);
        registerPwdEdit = (EditText)findViewById(R.id.register_pwd_edit);
        registerPwdConfirmEdit = (EditText)findViewById(R.id.register_pwd_confirm_edit);
        registerCommitButton = (Button)findViewById(R.id.register_commit_button);
        registerCommitButton.setOnClickListener(this);
        rgisterClearBtn = (Button)findViewById(R.id.register_clear_button);
        rgisterClearBtn.setOnClickListener(this);
        registerHasReadChk = (CheckBox)findViewById(R.id.register_has_read_chk);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_register, menu);
        return true;
    }

    /*
     * clearAllEdit
     * 清除当前界面所有的输入内容
     * */
    private void clearAllEdit() {
    	registerNameEdit.setText("");
    	registerPwdEdit.setText("");
        registerPwdConfirmEdit.setText("");
    }
    
	@Override
	public void onClick(View v) {
		int id = v.getId();
		switch(id) {
		case R.id.register_commit_button:
			break;
		case R.id.register_clear_button:
			clearAllEdit();
			break;
		default:
			break;
		}
	}
}
